const Promise = require("./es6-promise.js")
const config =require("./../api/config.js");

const _request =(url,data)=>{
  let promise = new Promise((resolve, reject) => {
    let config = {
      url: url,
      data:data,
      method: 'GET',
      success: function (res) {
        resolve(res);
      },
      fail:function(err){
        reject(config.CONST.ERR_E+err);
      }
    };
    wx.request(config)
  })
  return promise;
}

module.exports ={
  _request
}